package com.edu.test;

import com.edu.bean.User;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MyTest02 {

    ApplicationContext context;

    @Before
    public void init(){
        context = new ClassPathXmlApplicationContext("spring-ioc2.xml");
    }

    @Test
    public void test01(){
        User user = context.getBean("user",User.class);
        System.out.println(user);
        System.out.println(user.getCar());
        System.out.println(user.getPhone());
        // 嵌套bean 无法被容器直接获取
//        System.out.println(context.getBean("myPhone"));
        System.out.println(user.getIdCard());
        System.out.println(user.getPhoneNums());
        System.out.println(user.getRelations());



    }



}
